package com.sgb.businessmodule.api;

import com.sgb.businessmodule.entity.BusinessRequestEntity;
import com.sgb.businessmodule.entity.HomeBusinessListEntity;
import com.sgb.businessmodule.entity.PickFilterEntity;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.base.model.entity.H5ReEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.swgk.core.base.model.factory.BaseUrlInterceptor;
import com.swgk.core.view.countmenu.CountMenuEntity;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

public interface BusinessAPI {
//    https://gateway.shigongbang.com/sgb-gongdui/employment/apply/checkEmploymentApply?employmentNo=1397017612109615104你用这个接口判断吧

    //临时用工-校验货源是否报名
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @GET("team/employment/apply/checkEmploymentApply")
    Call<BaseEntity<Boolean>> checkEmploymentApply(@Query("employmentNo") String no);

    //货运大厅-校验货源是否有效
    @POST("logistics/app/goodsSourceStatusCheck")
    Call<BaseEntity<BaseEntity>> goodsSourceStatusCheck(@Body Map map);

    //通过路由获取H5访问路径
//    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
//    @POST("v1/app/common/getUrlSetting")
    @POST
    Call<BaseEntity<H5ReEntity>> getUrlSetting(@Url String url,@Query("param") String param);

    //商机首页—顶部菜单栏获取
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @GET("opportunity/categorys")
    Call<BaseEntity<List<CountMenuEntity>>> getMenuData();

    //商机首页—列表数据获取
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @POST("opportunity/portal")
    Call<BaseEntity<ListResponse<List<HomeBusinessListEntity>>>> getHomeBusinessData(@Body BusinessRequestEntity map);

    //商机大厅筛选---商机类型
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @GET("opportunity/types")
    Call<BaseEntity<List<PickFilterEntity>>> getBusinessStyle(@Query("no") String no);

    /**
     * 获取省市地址列表
     * @return 省市区列表
     */
    @GET("common/simpleArea.json")
    Call<BaseEntity<List<PickFilterEntity<List<PickFilterEntity>>>>> getTwoCityList();

    //商机分类二级联动数据获取
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @GET("opportunity/categorys")
    Call<BaseEntity<List<PickFilterEntity<List<PickFilterEntity>>>>> getBusinessType2Data(@Query("getAll") String all);

    //商机分类四级联动数据获取
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @GET("opportunity/categorys")
    Call<BaseEntity<List<PickFilterEntity<List<PickFilterEntity<List<PickFilterEntity<List<PickFilterEntity>>>>>>>>> getBusinessTypeData(@Query("getAll") String all);

    //商机搜索---历史搜索
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @GET("opportunity/portal/search/record")
    Call<BaseEntity<List<String>>> getHistorySearch();

    //商机搜索---删除历史搜索
    @Headers({BaseUrlInterceptor.HEADERS_URL_SG, "tokenType:pc"})
    @POST("opportunity/portal/search/record")
    Call<BaseEntity<Boolean>> deleteHistorySearch();
}
